package com.itheima.note.feign;

import com.itheima.apis.note.INoteClient;
import com.itheima.model.common.dtos.ResponseResult;
import com.itheima.note.service.impl.NoteServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class NoteClient {
    @Autowired
    private NoteServiceImpl noteService;

    @GetMapping("/api/v1/note/book/count")
    public ResponseResult countNotesByBookForUser(@RequestParam Integer userId) {
        return noteService.countNotesByBookForUser(userId);
    }
}
